<?php namespace App\Http\Controllers\user\life;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;
use Input;
use App\Models\LifeProduct;
use Illuminate\Pagination\LengthAwarePaginator;
use Landish\Pagination\Pagination as BootstrapPresenter;
use App\Models\Collecttion;

class IndexController extends Controller {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function index()
	{


		return view('user.life.index')->withIsLife(true);
	}

	public function getLifeList()
	{
		$page = (int)Input::get("page");
		$row = (int)Input::get("row");
		$data = LifeProduct::with(["collect"])->skip(($page - 1)*$row)->take($row)->get()->toArray();
		return $this->json(['data' => $data]);
	}

	// 后台用户列表

	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function create()
	{
		//
	}

	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//
	}

	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}
}
